<?php

class PossessingPlayer extends Player {

    private $master = null;
    private $slave = null;

    public function __construct($master, $slave) {
        $this->master = $master;
        $this->slave = $slave;
    }

    public function startTurn(Game $game) {
        ScreenDisplay::addScreenMessage($game, true, NEW_LINE, NEW_LINE);
        ScreenDisplay::addScreenMessage($game, true, "start a possessing turn on ".$slave->getName(), "starts a possessing turn on ".$slave->getName(), null, true, false);

        $this->resources->startTurn();
        $this->piles->startTurn($game, $nextPlayer->name);
        $playHand = $nextPlayer->getPlayHand();
        $actiontsFound = false;
        foreach ($playHand as $card) {
            if ($card instanceof iAction) {
                $actiontsFound = true;
                break;
            }
        }

        if ($actiontsFound)
            $this->setPhase($game, Phase_Action);
        else
            $this->setPhase($game, Phase_Payment);
        $this->numberOfActionsPlayed = 0;
        $this->numberOfTreasuresPlayed = 0;

        alertPlayer($this->name);
    }

}

?>
